home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 322 / flex / flexskfa.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  3.0 KB  |  115 lines

  1. /*  this used to be called fastskeldef.h -- jrd */
  2. /*  macro definitions for fast/full-table  C/FTL programs generated by flex */
  3.  
  4. #include "flexskcm.h"        /*  was flexskelcom.h -- jrd */
  5.  
  6. #define YY_END_OF_BUFFER_CHAR 0
  7.  
  8. /* action number for "not an accepting state; back-track (not implemented)" */
  9. #define YY_BACK_TRACK 0
  10.  
  11. /* action number for end-of-buffer was seen */
  12. #define YY_END_OF_BUFFER -3
  13.  
  14. /* reinitializes everything except the current start condition.  The last
  15.  * input character is set to a newline so an initial beginning-of-line
  16.  * rule will match
  17.  */
  18. #define YY_FAST_INIT \
  19.     { \
  20.     yytext = yy_c_buf_p = &yy_ch_buf[1]; \
  21.     yyleng = 0; \
  22.     yy_hold_char = *yy_c_buf_p; \
  23.     }
  24.  
  25. /* done before the next pattern has been matched action
  26.  * change both of these if you change them at all!
  27.  */
  28. #define YY_DO_BEFORE_SCAN \
  29.     *yy_c_buf_p = yy_hold_char
  30. #define YY_DO_BEFORE_RESTART \
  31.     yy_hold_char = *yy_c_buf_p
  32.  
  33. /* done after the current pattern has been matched and before the
  34.  * corresponding action
  35.  */
  36. #define YY_DO_BEFORE_ACTION \
  37.     yytext = yy_b_buf_p; \
  38.     yyleng = YY_LENG; \
  39.     yy_hold_char = *yy_c_buf_p; \
  40.     *yy_c_buf_p = '\0'
  41.  
  42. /* returns the length of the matched text */
  43. #define YY_LENG (yy_c_buf_p - yy_b_buf_p)
  44.  
  45. #ifdef FLEX_FULL_TABLE
  46. #define YY_CS_TYPE int
  47. #else
  48. #define YY_CS_TYPE struct yy_trans_info *
  49. #endif
  50.  
  51. /* find starting state */
  52. #ifdef FLEX_FULL_TABLE
  53. #    define YY_FIND_START_STATE( x ) \
  54.         x = yy_start; \
  55.         if ( yy_b_buf_p[-1] == '\n' ) \
  56.         ++x
  57. #else
  58. #    define YY_FIND_START_STATE( x ) \
  59.         x = yy_state_ptr[yy_start]; \
  60.         if ( yy_b_buf_p[-1] == '\n' ) \
  61.         x = yy_state_ptr[yy_start + 1]
  62. #endif
  63.  
  64. # ifdef FLEX_USE_ECS
  65. #     define yy_eq(x) e[x]
  66. # else
  67. #     define yy_eq(x) x
  68. # endif
  69.  
  70. /* get next jam state from packed table */
  71. #ifdef FLEX_FULL_TABLE
  72. #    define YY_FIND_NEXT_MATCH \
  73.         { \
  74.         register int yy_state_info; \
  75.         while ( (yy_state_info = n[yy_current_state][yy_eq(*yy_c_buf_p)] ) != YY_JAM ) \
  76.         { \
  77.         yy_current_state = yy_state_info; \
  78.         YY_BACKTRACKING_ACTION \
  79.         yy_c_buf_p++; \
  80.         } \
  81.         }
  82. #else
  83. #    define YY_FIND_NEXT_MATCH \
  84.         for ( yy_c = yy_eq(*yy_c_buf_p); \
  85.           (yy_trans_info = &yy_current_state[yy_c])->v == yy_c; \
  86.           yy_c = yy_eq(*++yy_c_buf_p) ) \
  87.         { \
  88.         yy_current_state += yy_trans_info->n; \
  89.         YY_BACKTRACKING_ACTION \
  90.         }
  91. #endif
  92.  
  93. #ifdef FLEX_FULL_TABLE
  94. #    define YY_FIND_ACTION( x ) x = l[yy_current_state]
  95. #else
  96. #    define YY_FIND_ACTION( x ) x = yy_current_state[-1].n
  97. #endif
  98.  
  99.  
  100. #ifdef FLEX_FULL_TABLE
  101. #    define YY_GET_NEXT_STATE yy_cur_state = n[yy_cur_state][*(yy_temp_char_ptr++)]
  102. #else
  103. #    define YY_GET_NEXT_STATE yy_cur_state += yy_cur_state[*(yy_temp_char_ptr++)].n
  104. #endif
  105.  
  106. #define EOB_ACT_RESTART_SCAN 2
  107. #define EOB_ACT_END_OF_FILE 3
  108. #define EOB_ACT_LAST_MATCH 4
  109.  
  110. #ifdef FLEX_FULL_TABLE
  111. #define YY_DECLARE_YY_CS_PARAM int *yy_current_state
  112. #else
  113. #define YY_DECLARE_YY_CS_PARAM struct yy_trans_info *yy_current_state
  114. #endif
  115.